import java.util.*;

public class Male extends Person {
	private int numberFatherhoods;

	public Male(String name, String surname, int age, String phone,
			int numberFatherhoods) {
		super(name, surname, age, phone);
		this.numberFatherhoods = numberFatherhoods;
	}

	public void setNumberFatherhoods() {
		Scanner sc = new Scanner(System.in);
		numberFatherhoods = sc.nextInt();
		sc.close();
	}

	public int getNumberFatherhoods() {
		return numberFatherhoods;
	}

	@Override
	public String toString() {
		super.toString();
		String s = "";
		s += numberFatherhoods;
		return s;
	}

	@Override
	public boolean equals(Object obj) {
		super.equals(obj);
		Male male = (Male) obj;
		if (male.numberFatherhoods == numberFatherhoods) {
			return true;
		}

		return false;
	}

	@Override
	public int hashCode() {
		int hash = 1;
		hash = hash * 17 + numberFatherhoods;
		hash = 17 * hash + name.hashCode();
		hash = 17 * hash + surname.hashCode();
		hash = 17 * hash + phone.hashCode();
		return hash;
	}

	public boolean matchByFatherhoods(int numberFatherhoods) {
		return this.numberFatherhoods == numberFatherhoods;
	}
}
